package com.harassment.interception.data.databases.dao;

import android.arch.persistence.room.Dao;
import android.arch.persistence.room.Delete;
import android.arch.persistence.room.Insert;
import android.arch.persistence.room.Query;
import android.arch.persistence.room.Update;


import com.harassment.interception.data.databases.entities.InterceptedSms;

import java.util.List;

@Dao
public interface InterceptedSmsDao {
    @Insert
    void addInterceptedSms(InterceptedSms... interceptedSms);

    @Delete
    void deleteInterceptedSms(InterceptedSms... interceptedSms);

    @Update
    void updateInterceptedSms(InterceptedSms... interceptedSms);

    @Query("select * from intercepted_sms order by id desc")
    List<InterceptedSms> getAllInterceptedSms();

    @Query("select * from intercepted_sms where number = :number")
    InterceptedSms getInterceptedSmsForNumber(String number);

}
